//
//  RMDateBaseManager.h
//  RMNote
//
//  Created by lanou3g on 16/4/15.
//  Copyright © 2016年 lxf. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <FMDB.h>
#import "RMBaseModel.h"
@interface RMDateBaseManager : NSObject

//数据库单例对象
@property(nonatomic,strong)FMDatabase * dataBase;

+(instancetype)defaultManager;

-(void)closeDB;

//mark!!!:创建表
-(void)createTable:(NSString *)tableName;

//mark!!!:增
-(BOOL)insertIntoTable:(NSString *)tableName  createDate:(NSDate *)date Model:(RMBaseModel *)model;

//mark!!!:删
-(BOOL)deleteNoteFromTableName:(NSString *)tableName  byCreateDate:(NSDate *)date;
-(BOOL)deleteNoteFromTableName:(NSString *)tableName withArray:(NSArray *)array;

//mark!!!:改
-(BOOL)updateNoteFromTableName:(NSString *)tableName  withModel:(RMBaseModel *)model byCreateDate:(NSDate *)date;

//mark!!!:查
-(NSArray *)selectNoteFromTable:(NSString *)tableName;

-(NSArray *)selectNotebySQLStr:(NSString *)sqlStr;

-(NSArray *)selectCreateDateFromTable:(NSString *)tableName;

//mark!!!:根据时间查表中的model
- (NSArray *)selectNoteFromTable:(NSString *)tableName byCreateDate:(NSDate *)date;

//

@end
